package rsee.com;

import com.video.h264.GlobalUtil;
import com.video.h264.TextCor;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;


public class MoreActivity extends Activity
{
	private TextCor autoScrollTextView = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setTheme(android.R.style.Theme_Black_NoTitleBar_Fullscreen);

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        
		this.setContentView(R.layout.more);
		
        autoScrollTextView = (TextCor)findViewById(R.id.TextViewNotice);
        autoScrollTextView.init(getWindowManager());
        autoScrollTextView.startScroll();
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_BACK)
		{
			new AlertDialog.Builder(this)
				.setTitle(R.string.IDS_Out)
				.setPositiveButton(R.string.IDS_Btn_OK, new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						android.os.Process.killProcess(android.os.Process.myPid());
					}
				})
				.setNegativeButton(R.string.IDS_Btn_Quit, new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
					}
				})
				.show();
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}
	
    @Override
	protected void onResume() {
        super.onResume();
		if(GlobalUtil.OVSIAlarmConfig){
			ActivityList activityList = new ActivityList();
			activityList.put(this, 0);
			}
    }
	
    @Override
	protected void onDestroy() {
        super.onDestroy();
		if(GlobalUtil.OVSIAlarmConfig){
			ActivityList activityList = new ActivityList();
			activityList.remove(this);
			}
    }
}